home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual Basic new SourceCode and Projects / CD-Player / Form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-07-02  |  4.5 KB  |  138 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form MenuForm 
  4.    BorderStyle     =   4  'Festes Werkzeugfenster
  5.    Caption         =   "Player"
  6.    ClientHeight    =   2100
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   3675
  10.    Icon            =   "Form1.frx":0000
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    Moveable        =   0   'False
  15.    ScaleHeight     =   2100
  16.    ScaleWidth      =   3675
  17.    ShowInTaskbar   =   0   'False
  18.    Begin VB.TextBox Text5 
  19.       Height          =   285
  20.       Left            =   6120
  21.       TabIndex        =   4
  22.       Text            =   "Text5"
  23.       Top             =   1200
  24.       Width           =   1335
  25.    End
  26.    Begin VB.TextBox Text4 
  27.       Height          =   285
  28.       Left            =   6120
  29.       TabIndex        =   3
  30.       Text            =   "Text4"
  31.       Top             =   960
  32.       Width           =   1335
  33.    End
  34.    Begin VB.TextBox Text3 
  35.       Height          =   285
  36.       Left            =   6120
  37.       TabIndex        =   2
  38.       Text            =   "Text3"
  39.       Top             =   720
  40.       Width           =   1335
  41.    End
  42.    Begin VB.TextBox Text2 
  43.       Height          =   285
  44.       Left            =   6120
  45.       TabIndex        =   1
  46.       Text            =   "Text2"
  47.       Top             =   480
  48.       Width           =   1335
  49.    End
  50.    Begin VB.TextBox Text1 
  51.       Height          =   285
  52.       Left            =   6120
  53.       TabIndex        =   0
  54.       Text            =   "Text1"
  55.       Top             =   240
  56.       Width           =   1335
  57.    End
  58.    Begin MSComDlg.CommonDialog CommonDialog1 
  59.       Left            =   120
  60.       Top             =   0
  61.       _ExtentX        =   847
  62.       _ExtentY        =   847
  63.       _Version        =   393216
  64.       CancelError     =   -1  'True
  65.    End
  66.    Begin VB.Menu mOptions 
  67.       Caption         =   "&Options"
  68.       Begin VB.Menu mChangeBackgroundPicture 
  69.          Caption         =   "Change Background &Picture"
  70.       End
  71.       Begin VB.Menu mInstructions 
  72.          Caption         =   "&Instructions"
  73.       End
  74.       Begin VB.Menu mSeparator 
  75.          Caption         =   "-"
  76.       End
  77.       Begin VB.Menu mExit 
  78.          Caption         =   "&Exit"
  79.       End
  80.    End
  81. Attribute VB_Name = "MenuForm"
  82. Attribute VB_GlobalNameSpace = False
  83. Attribute VB_Creatable = False
  84. Attribute VB_PredeclaredId = True
  85. Attribute VB_Exposed = False
  86. Option Explicit
  87. Private hRgn As Long
  88. Private Const OFN_FILEMUSTEXIST = &H1000
  89. Private Const OFN_HIDEREADONLY = &H4
  90. Private Const OFN_LONGNAMES = &H200000
  91. Private Const OFN_NONETWORKBUTTON = &H20000
  92. Private Const OFN_PATHMUSTEXIST = &H800
  93. Private Const CC_FULLOPEN = &H2
  94. Private Const CC_SOLIDCOLOR = &H80
  95. Private Const CC_RGBINIT = &H1
  96. Private Const CC_ANYCOLOR = &H100
  97. Private Sub Form_Load()
  98.     CommonDialog1.Color = vbWhite
  99.     SetRegion
  100.     ShapedForm.Show
  101. End Sub
  102. Private Sub Form_Unload(Cancel As Integer)
  103.     If hRgn Then DeleteObject hRgn
  104.     Unload ShapedForm
  105. End Sub
  106. Private Sub mChangeBackgroundPicture_Click()
  107.     On Error Resume Next
  108.     Err.Clear
  109.     With CommonDialog1
  110.         .DialogTitle = "Please Select a Picture"
  111.         .Flags = OFN_FILEMUSTEXIST + OFN_HIDEREADONLY + OFN_LONGNAMES + OFN_NONETWORKBUTTON + OFN_PATHMUSTEXIST
  112.         .Filter = "All Picture Files|*.bmp;*.dib;*.gif;*.jpg;*.wmf;*.emf;*.ico;*.cur|Bitmaps (*.bmp;*.dib)|*.bmp;*.dib|GIF Images (*.gif)|*.gif|JPEG Images (*.jpg)|*.jpg|Metafiles (*.wmf;*.emf)|*.wmf;*.emf|Icons (*.ico;*.cur)|*.ico;*.cur|All Files (*.*)|*.*"
  113.         .ShowOpen
  114.         If Err.Number = 32755 Then Exit Sub
  115.         .Flags = CC_FULLOPEN + CC_SOLIDCOLOR + CC_RGBINIT + CC_ANYCOLOR
  116.         .ShowColor
  117.         If Err.Number = 32755 Then Exit Sub
  118.         On Error GoTo erro
  119.         ShapedForm.Visible = False
  120.         DoEvents
  121.         ShapedForm.Picture = LoadPicture(.FileName)
  122.         ShapedForm.Width = ShapedForm.Picture.Width
  123.         ShapedForm.Height = ShapedForm.Picture.Height
  124.         SetRegion
  125.     End With
  126. erro:
  127.     If Err.Number <> 0 Then MsgBox "Error Number " & Err.Number & " : " & Err.Description, vbApplicationModal + vbCritical
  128.     ShapedForm.Visible = True
  129. End Sub
  130. Private Sub mExit_Click()
  131.     Unload Me
  132. End Sub
  133. Private Sub SetRegion()
  134.     If hRgn Then DeleteObject hRgn
  135.     hRgn = GetBitmapRegion(ShapedForm.Picture, CommonDialog1.Color)
  136.     SetWindowRgn ShapedForm.hwnd, hRgn, True
  137. End Sub
  138.